<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<link rel="stylesheet" href="<%=path%>/css/manager/bbs_economist.css">
<link rel="stylesheet" href="<%=path%>/css/page.css">
<script type="text/javascript"
	src="<%=path%>/js/manager/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/js/manager/bbs_economist.js"></script>
<script type="text/javascript" src="<%=path%>/js/page.js"></script>
<title>论坛学人管理</title>
</head>
<body>
	<!--
        	作者：offline
        	时间：2016-12-22
        	描述：论坛学人管理内容头部
        -->
		<div class="bbs_mist_div1">论坛学人管理</div>
		<div class="news_div2">
		<form action="bbslist.htm" id="sform" method="post">
        	<input class="news_div2_in1" type="text" placeholder="学人名字" name="condition" id="condition" value="${bbs.condition}"/>
        	<input class="news_div2_in2" type="submit" value="查找" onclick="return submitCheck()"/>
        	<input type="hidden"
				id="pageIndex" name="pageIndex" value="${bbs.pageInfo.pageIndex}" />
			<input type="hidden" id="pageSize" name="pageSize"
				value="${bbs.pageInfo.pageSize}" />
			<input type="hidden" id="markManage" name="markManage"
				value="0" />
			<input type="hidden" id="bbsId" name="bbsId"
				value="0" />
        	</form>
        </div>
        <div class="bbs_mist_div2">
        	<input class="bbs_mist_div2_in1" type="button" onclick="manage(1,0)"/>
        	<div class="bbs_mist_div2_div1">
        		<div class="bbs_mist_div2_div1_div1">学人名称</div>
        		<div class="bbs_mist_div2_div1_div2">学人照片</div>
        		<!-- <div class="bbs_mist_div2_div1_div3">状态</div> -->
        		<!-- <div class="bbs_mist_div2_div1_div4">上线时间</div> -->
        		<div class="bbs_mist_div2_div1_div5">操作</div>
        	</div>
        	<div class="bbs_mist_div2_div2">
        		<c:forEach items="${list}" var="examples">
        		<div class="bbs_mist_div2_div2_div1">
        			<div class="bbs_mist_div2_div2_div1_div1"><a href="javascript: manage(3,'${examples.bbsId}')">${examples.bbsName}</a></div>
        			<div class="bbs_mist_div2_div2_div1_div2">
        				<img src="/upload/images/bbs/${examples.bbsImg}" />
        			</div>
        			<%-- <div class="bbs_mist_div2_div2_div1_div3">
							<c:if test="${examples.bbsStatus==1}">待发布</c:if>
							<c:if test="${examples.bbsStatus==2}">已发布</c:if></div> --%>
        			<%-- <div class="bbs_mist_div2_div2_div1_div4"><fmt:formatDate value="${examples.bbsAddtime}"
								pattern="yyyy-MM-dd HH:mm:ss" /></div> --%>
        			<div class="bbs_mist_div2_div2_div1_div5">
        				<a href="javascript: manage(3,'${examples.bbsId}')">查看</a>
        				<a href="javascript: manage(2,'${examples.bbsId}')">编辑</a>
        				<a href="javascript: manage(4,'${examples.bbsId}')">删除</a>
        			</div>
        		</div>
        		</c:forEach>
        		 
        	</div>
        	<div class="bbs_mist_div2_div3">
        		<select onchange="setPageSize()" id="pageSize_sel">
        			<option
					<c:if test="${banner.pageInfo.pageSize==10}">selected="selected"</c:if>>10</option>
				<option
					<c:if test="${banner.pageInfo.pageSize==15}">selected="selected"</c:if>>15</option>
				<option
					<c:if test="${banner.pageInfo.pageSize==20}">selected="selected"</c:if>>20</option>
        		</select>
        		<span>/每页，共${bbs.pageInfo.totalRec}条记录</span>
        </div>
        <div class="page">
		<!-- 分页 -->
		<c:set value="${bbs.pageInfo}" var="pageInfo"></c:set>
		<%@include file="../template/pageTemplate.jsp"%>
		</div>
        </div>
</body>
<script type="text/javascript">
	//提交验证
	function submitCheck() {
		//1.搜索框去掉前后空格
		var condition = $.trim($("#condition").val());
		$("#condition").val(condition);
		return true;
	}
	//操作：type:1添加；2编辑；3查看；4删除
	function manage(type,id){
		$("#markManage").val(type);
		$("#bbsId").val(id);
		$("#sform").attr("action", "tobbsmange.htm");  
		$("#pageIndex").attr("name","pageInfo.pageIndex");  
		$("#pageSize").attr("name","pageInfo.pageSize");  
		if(type==4){
			if(window.confirm("确定要删除该学人信息吗？")){
				$("#sform").attr("action", "bbsmange.htm");  
	         }else{
	        	 return false;
	        	 }
		}
		$("#sform").submit();
		
	}
</script>
</html>

